<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>理解原型</title>
</head>
<body>
  <script>
    let biped = {
      numLegs: 2
    };

    let person = Object.create(biped);
    person.name = 'Matt';

    console.log(person.name);  // Matt
    console.log(person.numLegs);  // 2
    console.log(Object.getPrototypeOf(person) === biped);  // true
  </script>
</body>
</html>